//
//  ViewController.m
//  10506
//
//  Created by student on 16/2/19.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *text1;
@property (weak, nonatomic) IBOutlet UITextField *text2;
@property (weak, nonatomic) IBOutlet UILabel *result;


@end

@implementation ViewController
- (IBAction)sub:(id)sender
{
//    self.result.text=[NSString stringWithFormat:@"%i",([self.text1.text intValue]+[self.text2.text intValue])];
    int a=[self.text1.text intValue];
    int b=[self.text2.text intValue];
    int sub=a+b;
    NSString *string=[NSString stringWithFormat:@"%i",sub];
    self.result.text=string;
    
}
- (IBAction)back:(id)sender
{
    [self.view endEditing:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
